/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

/**
 *
 * @author Marco
 */
public class Course {

    private int courseID;
    private String courseName, courseLanguage, courseDescription;
    private boolean finaltest;
    private boolean questions = false;
    private String price;
    private Locale loc = new Locale("en");
    private String pattern = "###.00";
    private NumberFormat nf = NumberFormat.getNumberInstance(loc);
    private DecimalFormat df = (DecimalFormat) nf;

    public void setCourseID(int courseID) {
        this.courseID = courseID;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setCourseLanguage(String courseLanguage) {
        this.courseLanguage = courseLanguage;
    }

    public void setCourseDescription(String courseDescription) {
        this.courseDescription = courseDescription;
    }

    public void setFinaltest(boolean finaltest) {
        this.finaltest = finaltest;
    }

    public void setPrice(double price) {
        this.price = df.format(price);
    }

    public boolean isQuestions() {
        return questions;
    }

    public void setQuestions(boolean questions) {
        this.questions = questions;
    }

    public Course() {
        df.applyPattern(pattern);
    }

    public String getCourseDescription() {
        return courseDescription;
    }

    public int getCourseID() {
        return courseID;
    }

    public String getCourseLanguage() {
        return courseLanguage;
    }

    public String getCourseName() {
        return courseName;
    }

    public boolean isFinaltest() {
        return finaltest;
    }

    public String getPrice() {
        return price;
    }

    public Course(String courseName, String courseLanguage, String courseDescription, boolean finaltest, double price) {
        df.applyPattern(pattern);
        this.courseName = courseName;
        this.courseLanguage = courseLanguage;
        this.courseDescription = courseDescription;
        this.finaltest = finaltest;
        this.price = df.format(price);
    }
}
